#ifndef DBHELPER_H
#define DBHELPER_H
#include "QtSql"
#include "QMap"
#include "QVariantMap"
#include "QList"

class dbhelper
{
public:
    dbhelper();
    bool GetConnection();
    bool GetConnection(QString dbName);
    void DisConnection();

    bool InitDataBase();

    int Insert(QString table,QVariantMap map);
    bool Update(QString table,QVariantMap map,QString filter);
    bool Delete(QString table,QString filter);
    QList<QVariantMap> SimpleSelect(QString table,QStringList columns,QVariantMap map,QString otherFilter);
    QList<QVariantMap> CustomSelect(QString strSql,QVariantMap map);

    ~dbhelper();
    QSqlDatabase _db;


};


#endif // DBHELPER_H
